<template>
  <div class="xtx-dialog" v-show="maydialog.flag">
    <div class="wrapper">
      <div class="header">
        <h3>{{ maydialog.title }}</h3>
        <!-- @click="maydialog.flag = false" -->
        <a
          href="JavaScript:;"
          class="iconfont icon-close-new"
          @click="change"
        ></a>
      </div>
      <div class="body">
        <slot name="footer"></slot>
      </div>
      <div class="footer">
        <button
          type="gray"
          style="margin-right: 20px"
          class="btn bt"
          @click="quxiao"
        >
          取消
        </button>
        <button type="primary" class="btn" @click="change">确认</button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ["maydialog"],
  data() {
    return {};
  },

  mounted() {},

  methods: {
    quxiao() {
      this.$emit("change", false);
    },
    change() {
      this.$emit("change", false);
    },
  },
};
</script>

<style lang="scss" scoped>
@import "@/assets/css/color.scss";

.btn {
  width: 180px;
  height: 50px;
  font-size: 16px;
  border-color: #27ba9b;
  background: #27ba9b;
  color: #fff;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
}
.bt {
  border-color: #ccc;
  background: #ccc;
}
.xtx-dialog {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 8887;
  background: rgba(0, 0, 0, 0.3);
  //   &.fade {
  //     transition: all 0.4s;
  //     background: rgba(0, 0, 0, 0.5);
  //   }
  .wrapper {
    width: 600px;
    background: #fff;
    border-radius: 4px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    opacity: 1;
    &.fade {
      transition: all 0.4s;
      transform: translate(-50%, -50%);
      opacity: 1;
    }
    .body {
      padding: 20px 40px;
      font-size: 16px;
      .icon-warning {
        color: $priceColor;
        margin-right: 3px;
        font-size: 16px;
      }
    }
    .footer {
      text-align: center;
      padding: 10px 0 30px 0;
    }
    .header {
      position: relative;
      height: 70px;
      line-height: 70px;
      padding: 0 20px;
      border-bottom: 1px solid #f5f5f5;
      h3 {
        font-weight: normal;
        font-size: 18px;
      }
      a {
        position: absolute;
        right: 25px;
        top: 25px;
        font-size: 24px;
        width: 20px;
        height: 20px;
        line-height: 20px;
        text-align: center;
        color: #999;
        &:hover {
          color: #666;
        }
      }
    }
  }
}
</style>